# Maintainer: Konstantin Gizdov <arch at kge dot pw>
# Contributor: Oliver Bandel <oliver@first.in-berlin.de>

pkgname=ocaml-zarith
provides=('zarith')
pkgver=1.12
pkgrel=5
pkgdesc='Implements arithmetic and logical operations over arbitrary-precision integers and rational numbers'
url='https://github.com/ocaml/Zarith'
arch=('loong64' 'x86_64')
license=('GPL2')
depends=('ocaml>=4.14.0' 'ocaml-compiler-libs' 'gmp')
makedepends=('ocaml-findlib')
source=("https://github.com/ocaml/Zarith/archive/release-${pkgver}.tar.gz")
sha256sums=('cc32563c3845c86d0f609c86d83bf8607ef12354863d31d3bffc0dacf1ed2881')
options=(!strip)

build() {
  cd Zarith-release-${pkgver}

  ./configure -installdir "${pkgdir}/usr/lib/ocaml" # install ignores DESTDIR
  make -j1
}

package() {
  cd Zarith-release-${pkgver}

  mkdir -p "${pkgdir}/usr/lib/ocaml"
  OCAMLFIND_LDCONF=ignore make install
}
